<template>
  <div class="tmpl">
      <h4>{{list.title}}</h4>
      <p><span>发表时间：{{list.add_time | dataFormat}}</span><span>点击次数：{{list.click}}</span></p>
      <hr>
      <div v-html="list.content"></div>
      <comment :artId='$route.params.id'></comment>
      </div>
</template>
<script>
import {Toast} from 'mint-ui'
import comment from '../subcomm/comm.vue'
export default {
  data(){
      return {
          list:{}
          }

  },
  created(){
      this.getInfo()

  },
  methods:{
      getInfo(){
          this.$http.get('api/getnew/'+ this.$route.params.id).then(res=>{
              if(res.body.status==0){
                  this.list=res.body.message[0]
                  console.log(res)


              }else{
                  Toast('获取数据失败');
              }
          })
      }

  },
  components:{comment}
 

}
</script>
<style lang="scss">
.tmpl{
    padding: 5px;
    p{
         color: #26A2FF;
         display:flex;
         justify-content: space-between;
    }
}
img{

    width:100%;
}

</style>
